<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui-v2.7.6/layui/css/layui.css">
    <link rel="stylesheet" href="layui-v2.7.6/layui/css/public.css">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form" lay-filter="test1">
    <input type="hidden" name="ucode">
    <div class="layui-form-item">
        <label class="layui-form-label required">昵称：</label>
        <div class="layui-input-block">
            <input type="text" name="uname" lay-verify="required" lay-reqtext="昵称不能为空" placeholder="" value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">密码：</label>
        <div class="layui-input-block">
            <input type="text" name="upwd" placeholder="请输入密码" value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">角色：</label>
        <div class="layui-input-block">
            <input type="radio" name="utype" value="0" title="普通人员" checked="">
            <input type="radio" name="utype" value="1" title="管理人员">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注：</label>
        <div class="layui-input-block">
            <input type="text" name="umemo" placeholder="请输入备注" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
        </div>
    </div>
</div>
<script src="layui-v2.7.6/layui/layui.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
    //获取要修改的对象
    var obj = JSON.parse(localStorage.getItem("user"));
    layui.use(['form','upload'], function () {
        var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            $ = layui.$;
        //渲染 给表单赋值
        form.val("test1",obj)
        console.log(obj)

    });
</script>
</body>
</html>